#include "BPEBoundingBox.h"

BPEBoundingBox::BPEBoundingBox(){
	this->bBox = BPEBox3d();
};
BPEBoundingBox::BPEBoundingBox(const BPEBox3d &b){
	this->bBox = b;
};

BPEBox3d BPEBoundingBox::getBoundingBox(){
	return this->bBox;
};
bool BPEBoundingBox::collide(BPEBoundingShape *other,BPEVector3d &normal, double &depth){

	return this->getBoundingBox().collide(&other->getBoundingBox(),normal,depth);

};
BPEVector3d BPEBoundingBox::getCenter(){
	return BPEVector3d(BPEPoint3d(0,0,0),this->bBox.getCenter());
};
void BPEBoundingBox::setCenter(const BPEPoint3d &c){
	this->bBox.setCenter(c);
};
void BPEBoundingBox::setRotation(const BPEVector3d &rads){
	this->bBox.setRotation(rads);
};

void BPEBoundingBox::updatePositionAndRotation(const BPEPoint3d &position, BPEVector3d rotation){

	this->setCenter(position);
  if(rotation.getMagnitude() != 0)
	  this->setRotation(rotation);

};

char BPEBoundingBox::getType(){
	return 'b';
};